
public class Headline extends AbstractLeaf
{
	private int sectionLevel ;
	private boolean isOrdered = false;
	public Headline(String value, int sectionLevel) 
	{
		super(value);
		this.sectionLevel = sectionLevel ;
		
	}

	@Override
	public String toDokuWiki() 
	{
		if(isOrdered)
		{
			return "Operaja niedostepna w dokuwiki" ;
		}
		StringBuilder stringBuilder = new StringBuilder() ;
		for(int i = 0 ; i < sectionLevel ; i++)
			stringBuilder.append("=") ;
		stringBuilder.append(value) ;
		for(int i = 0 ; i < sectionLevel ; i++)
			stringBuilder.append("=") ;
		return stringBuilder.toString() ;
	}

	@Override
	public String toMediaWiki() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String toText2tags() 
	{
		char symbol ;
		if(isOrdered)
			symbol = '+' ;
		else
			symbol = '=' ;
		StringBuilder stringBuilder = new StringBuilder() ;
		for(int i = 0 ; i < sectionLevel ; i++)
			stringBuilder.append(symbol) ;
		stringBuilder.append(value) ;
		for(int i = 0 ; i < sectionLevel ; i++)
			stringBuilder.append(symbol) ;
		return stringBuilder.toString() ;
	}
	
	public void setOrdered()
	{
		this.isOrdered = true ;
	}
}
